package org.mnswf.model {
	
	public class Endorsement {
		
		[Bindable]
		public var id:int;
		[Bindable]
		public var memberId:int;
		[Bindable]
		public var authorName:String;
		[Bindable]
		public var rank:int;
		[Bindable]
		public var message:String;
		[Bindable]
		public var messageFormatted:String;
		[Bindable]
		public var isApproved:Boolean;
		[Bindable]
		public var dateAdded:Date;
		
		public function Endorsement() {
			id = -1;
		}
		
		public function parseTransferObject(transferObject:Object):void {
			id = (transferObject.ID != null) ? transferObject.ID : transferObject.id;
			memberId = (transferObject.MEMBERID != null) ? transferObject.MEMBERID : transferObject.memberId;
			authorName = (transferObject.AUTHORNAME != null) ? transferObject.AUTHORNAME : transferObject.authorName;
			rank = (transferObject.RANK != null) ? transferObject.RANK : transferObject.rank;
			message = (transferObject.MESSAGE != null) ? transferObject.MESSAGE : transferObject.message;
			messageFormatted = (transferObject.MESSAGEFORMATTED != null) ? transferObject.MESSAGEFORMATTED : transferObject.messageFormatted;
			isApproved = (transferObject.ISAPPROVED != null) ? transferObject.ISAPPROVED : transferObject.isApproved;
			dateAdded = (transferObject.DATEADDED != null) ? transferObject.DATEADDED : transferObject.dateAdded;
		}
		
	}
	
}